<?php
include("util/out_fxn.php");
session_start();
$old_user = $_SESSION['valid_user'];
// store to test if they *were* logged in
unset($_SESSION['valid_user']);
$result_dest = session_destroy();
// start output html
do_html_header('Logged Out');
if (!empty($old_user))
{
	if ($result_dest)
	{
		$senddData = "<table>
			<tr><td><h3>Successfully logged out</h3></td></tr>
			<tr><td>Would you like to <a href='Login.php'>re-login</a> now</h3></td></tr>
		</table>";
		do_gen_display($senddData);
	}
}
else
{
	$senddData = "<table>
			<tr><td><h3>You were not logged in, and so have not been logged out.</h3></td></tr>
			<tr><td>Would you like to <a href='Login.php'>login</a> now</h3></td></tr>
		</table>";
	// if they weren't logged in but came to this page somehow
	// echo 'You were not logged in, and so have not been logged out.<br />';
	do_gen_display($senddData);
}
do_html_footer();
?>